#include <stdio.h>
#include<stdlib.h>
int main() {
    int n = 0;
    scanf("%d",&n);
    int* p = (int*)realloc(NULL, n * sizeof(int));
    int i=0;
    for (i=0;i<n;i++){
        scanf("%d",p+i);
    }
    int re=0;
    scanf("%d",&re);
    for (i=0;i<n;i++){
        if (*(p+i) != re)
          printf("%d ",*(p+i));
    }
    free(p);
    p=NULL;
    return 0;
}
